/**
 *
 */
package wsepForum.network.server;

import java.net.Socket;

import wsepForum.domain.ForumDomain;
import wsepForum.network.server.gate.ConsoleUIContoller;

/**
* @author Oren Ben-Haim
*
*/
public class ConsoleConnectionHandlerFactory implements
		IConnectionHandlerFactory {

	/**
	 * Main forum domain
	 */
	final private ForumDomain domain;
	/**
	 *
	 */
	private ConsoleUIContoller ui;

	/*****************************
	 * CONSTRUCTOR               *
	 *****************************/
	public ConsoleConnectionHandlerFactory(ForumDomain domain, ConsoleUIContoller ui) {
		this.domain = domain;
		this.ui = ui;
	}

	public ConnectionHandler<?> newHandler(Socket socket) {
		return new ConsoleConnectionHandler(socket, this.domain.createNewSession(), this.ui);
	}

}
